package pers.jason.wppm.security.core.validate.code;

import java.time.LocalDateTime;

/**
 * 
 * @author Jason
 * @Date 2018-10-30 16:19
 *
 */
public class ValidateCode {

	private String code; //验证码
	
	private LocalDateTime expiredTime; //过期时间
	
	public ValidateCode(String code, int expiredIn) {
		this.code = code;
		this.expiredTime = LocalDateTime.now().plusSeconds(expiredIn);
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public LocalDateTime getExpiredTime() {
		return expiredTime;
	}

	public void setExpiredTime(LocalDateTime expiredTime) {
		this.expiredTime = expiredTime;
	}
	
	public boolean isExpried() {
		return LocalDateTime.now().isAfter(expiredTime);
	}

	@Override
	public String toString() {
		return "ValidateCode [code=" + code + ", expiredTime=" + expiredTime + "]";
	}

	
	
}
